﻿:: Always save this file without encoding
:: - 'File->Save DataModel\SPMetal.bat As...' 
:: - click down arrow on Save button, choose 'Save with encoding'
:: - in the 'Encoding' drop down list choose 'Unicode (UTF-8 without signature) - codepage 65001'

:: Replace this values with your local path
Echo Off
SET WEB_URL=http://win2008template/sites/test/

Echo Generating code ...
"C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\SPMetal" /web:%WEB_URL% /code:".\DataModel.cs" /namespace:PD.ShP.Code.DataModel /serialization:unidirectional /parameters:".\SPMetal.xml"

pause